package Class_03_15;

public class FruitTest {
    public static void main(String[] args) {
        Fruit[] arr = new Fruit[2];
        Fruit f1 = new Fruit( 0.86f,"yellow");
        Fruit f2 = new Fruit(0.73f,"red");
        arr[0] = f1;
        arr[1] = f2;

        double sum = 0.0;
        for (int i = 0; i < arr.length;i++)
        {
            Fruit f = arr[i];
            System.out.println(f.getWeight() + " " + f.getColor());
        }
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i].getWeight();
        }

        double avg = sum / arr.length;
        System.out.println(avg);
    }
}
